/*
 * CollectActivity.java
 * business
 *
 * Created by SunDing on 2016/9/9.
 *
 * Copyright (c) 2016年 yidiandao. All rights reserved.
 */

package com.yidiandao.business.ui.collect;

import android.app.Activity;
import android.content.Intent;

import com.yidiandao.business.R;
import com.yidiandao.business.base.BaseActivity;
import com.yidiandao.business.utils.ActivityUtils;

/** 我的收藏 */
public class CollectActivity extends BaseActivity {

    private CollectFragment mCollectFragment;

    public static void actionStart(Activity activity) {
        Intent intent = new Intent(activity, CollectActivity.class);
        activity.startActivity(intent);
    }

    @Override
    protected void initFragment() {
        mCollectFragment =
                (CollectFragment)
                        getSupportFragmentManager().findFragmentById(R.id.container_collect);
        if (mCollectFragment == null) {
            mCollectFragment = CollectFragment.getInstance();
            ActivityUtils.addFragmentToActivity(
                    getSupportFragmentManager(), mCollectFragment, R.id.container_collect);
        }
    }

    @Override
    protected void initPresenter() {
        new CollectPresenter(mCollectFragment);
    }

    @Override
    protected int getLayoutId() {
        return R.layout.activity_collect;
    }
}
